<h3>Danh sách bản tin</h3>
<hr>

<style>
	.action {
		float: right;
		margin-right: 50px;
	}
</style>
  <style>
	td a {
		text-decoration: none;	
	}
</style>
<p class="action">
<a onclick="$('form').submit();" href="#">
	<img src="<?php echo base_url()?>template/backend/images/btn_delete.png" style="border: 0px; float: right"></img>
</a>
<a href="<?php echo base_url()?>index.php/news/create" style="border: 0px; float: right; margin-right: 20px">
	<img src="<?php echo base_url()?>template/backend/images/btn_add.png"></img>
</a>
<span class="clear: right"></span>
</p>

<form action="<?php echo base_url().'index.php/news/delete'?>" method="post" enctype="multipart/form-data" id="form">
<table width="100%" cellpadding="7">
	<tr bgcolor="#bdbdbd">
		<td align="center"><input type="checkbox" onclick="$('input[name*=\'selected\']').attr('checked', this.checked);" /></td>
		<td>Tiêu đề</td>
		<!-- td>Nội dung</td -->
		<td>Ngày tháng</td>
		<td align="center">Hành động</td>
	</tr>
	<?php foreach ($news as $item): ?>
	<tr>
		<td align="center"><input type="checkbox" name="selected[]" value="<?php echo $item['id']; ?>" /> </td>
    	<td><a href="<?php echo base_url().'index.php/news/'. $item['slug'] ;?>"><?php echo $item['title'] ?></a></td>
        <!-- td><?php //echo $item['text'] ?></td -->
        <td><?php echo $item['create_on'] ?></td>
    	<td align="center">
    		<a href="<?php echo base_url().'index.php/news/'. $item['slug'] ;?>">Xem</a>
    		<a href="<?php echo base_url().'index.php/news/update/'.$item['id']?>">Sửa</a>
    	</td>
    </tr>
	<?php endforeach ?>
</table>
</form>
